


//kpi 数据提交
function submit(fomrname) {
	$('#'+fomrname+'').form('submit',{
		 onSubmit: function(){	
	 		return $(this).form('validate');
		 },
		 success:function(data){
			 var json = eval('(' + data + ')');  // change the JSON string to javascript object
			 if(json.errorMsg){
				 showMessage('错误',json.errorMsg);
			 } else  {
				 var tab = $('#MainTab').tabs('getSelected');  // get selected panel
				 tab.panel('refresh', 'kpi/index.html');
				 showMessage('成功','数据保存成功');
			 }
		}
	 });	
}
/**
 * 显示消息框
 */
function showMessage(title,message) {
	 $.messager.show({
		 title:title,
		 msg:message,
		 timeout:5000,
		 showType:'slide'
		 });
}

